In the simple harmonic oscillator simulation:
- If an applied force varies linearly with position, the force can be defined as F=ax where a is called the force constant.
- Once such a physical system where this force exists is with a common helical spring acting on a body.
- If the spring is stretched or compressed a small distance from its equilibrium position, the spring will exert a force on the body given by Hooke's Law, namely
Fs=-kx (1)
where Fs is known as the spring force.
- Here the constant of proportionality, k, is the known as the spring constant, and x is the displacement of the body from its equilibrium position (at x=0 ).
- The spring constant is an indication of the spring's stiffness.
- A large value for k indicates that the spring is stiff. A low value for k means the spring is soft.
- Generally speaking, springs with large k values can balance larger forces than springs with low k values.
- The negative sign in Equation 1 indicates that the direction of Fs is always opposite the direction of the displacement. This implies that the spring force is a restoring force.
- In other words, the spring force always acts to restore, or return, the body to the equilibrium position regardless of the direction of the displacement, as shown in Figures 5a - 5c.

Figure 5a. When the displacement is to the right (x > 0) the spring force is directed to the left ( Fs< 0).

Figure 5b. When the displacement is to the left (x < 0) the spring force is directed to the right ( Fs> 0).

Figure 5c. In both cases shown in Figures 5a and 5b, the effect of the spring force is to return the system to the equilibrium position. At this position, x= 0 and the spring is unstretched, signifying Fs= 0.
- When a mass, m, is suspended from a spring and the system is allowed to reach equilibrium, as shown in Figure 6, Newton's Second Law tells us that the magnitude of the spring force equals the weight of the body, Fs=mg.
- Therefore, if we know the mass of a body at equilibrium, we can determine the spring force acting on the body.

Figure 6. A body of mass, m, is suspended from a spring having a spring constant, k. If the system is in equilibrium the spring force is balanced by the weight of the body.
- Equation 1 applies to springs that are initially unstretched. When the body undergoes an arbitrary displacement from some initial position,
- xi, to some final position, xf, this equation can be written as
Fs=-kxf-xi=-k∆x where ∆x is the body's displacement.
- If the body in Figure 7 is displaced from its equilibrium position some maximum distance, A, and then released, it will oscillate about the equilibrium position.
- The body will move back and forth between the positions x=+A and x=-A. When the mass travels from the maximum displacement x=+A to the minimum displacement x=-A and then back to the position x=+A, we say that the mass has moved through one cycle, or oscillation.
- In the simple harmonic oscillator simulation, when an oscillating mass (as in the case of a mass bouncing on a spring) experiences a force that is linearly proportional to its displacement but in the opposite direction, the resulting motion is known as simple harmonic motion.
- This motion is periodic, meaning the displacement, velocity and acceleration all vary sinusoidally. The time required for the body to complete one oscillation is defined as the period, T, and is given by T=2πmk

Figure 7. Experiment setup
- Notice the period is dependent only upon the mass of the oscillating body and the spring constant,
- k. As the stiffness of the spring increases (that is, as k increases), the period decreases which has the effect of increasing the body's average velocity.
- Conversely, an increase in the body's mass means the period will also increase, thereby requiring more time for the body to move through one oscillation.
- It should be noted that the period of motion is independent of the amplitude of the oscillations.